package com.bishe.demo.modules.hotel.hotelRoom.dao;

import com.bishe.demo.modules.hotel.hotelRoom.entity.RoomUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RoomUserDao {
    @Insert("insert into hotel_room_user values(null,#{roomId},#{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insertRoomUser(RoomUser roomUser);

    @Delete("delete from hotel_room_user where user_id=#{userId}")
    void deleteRoomUserByUserId(int userId);
}
